<link rel="stylesheet" type="text/css" href="/Public/css/ico.css"/>
<form id="pagerForm" method="post" action="<?php echo __URL__;?>">
    <input type="hidden" name="status" value="<?php echo $this->input->get_post('status'); ?>">
    <input type="hidden" name="keywords" value="<?php echo $this->input->get_post('keywords'); ?>" />

    <input type="hidden" name="pageNum" value="<?php echo $this->input->get_post('pageNum');?>" /><!--【必须】value=1可以写死-->
    <input type="hidden" name="numPerPage" value="<?php echo $this->input->get_post('numPerPage');?>" /><!--【可选】每页显示多少条-->
    <input type="hidden" name="orderField" value="<?php echo $this->input->get_post('orderField');?>" /><!--【可选】查询排序-->
    <input type="hidden" name="orderDirection" value="<?php echo $this->input->get_post('orderDirection');?>" /><!--【可选】升序降序-->
</form>


<div class="pageHeader">
    <form onsubmit="return dwzSearch(this, 'dialog');" action="<?php echo __URL__;?>/index" method="post" rel="pagerForm">
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>
                        <a mask="true" target="dialog" href="<?PHP echo __URL__?>/index?searct_keyword=">
                            <?PHP echo $source_dir.DIRECTORY_SEPARATOR;?>
                        </a>
                            <input style="width: 300px;" type="text" name="searct_keyword" value="<?php echo $this->input->get_post('searct_keyword');?>" />
                    </td>
                    <td>
                        建档日期：<input type="text" name="created" class="date" readonly="true" value="<?php echo $this->input->get_post('created'); ?>" />
                    </td>
                </tr>
            </table>
            <div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
                    <!--<li><a class="button" href="demo_page6.html" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li>-->
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a class="add" href="<?php echo __URL__.'/upload_form';?>" target="dialog" rel="webuploader" ><span>上传文件</span></a></li>
            <li><a class="delete" href="<?php echo __URL__.'/delete';?>/{id}" target="ajaxTodo" title="确定要删除吗?"><span>删除文件</span></a></li>
            <li class="line">line</li>
            <li>
                <a class="icon" mask="true" target="dialog" href="<?PHP echo __URL__?>/index?searct_keyword=<?PHP echo dirname($this->input->get_post('searct_keyword'));?>">
                    <span>上一层</span>
                </a>
            </li>
        </ul>
    </div>

    <table class="list list-list" width="100%" layoutH="115" targetType="dialog" >
        <thead>
        <tr>
            <th class="<?php if('basename'==$this->input->get_post('orderField'))echo $this->input->get_post('orderDirection'); ?>" orderfield="basename">basename</th>
            <th width="80" class="<?php if('size'==$this->input->get_post('orderField'))echo $this->input->get_post('orderDirection'); ?>" orderfield="size">size</th>
            <th class="<?php if('date'==$this->input->get_post('orderField'))echo $this->input->get_post('orderDirection'); ?>" orderfield="date">
                <div title="date" class="gridCol">date</div>
            </th>


            <th width="100">操作</th>
        </tr>
        </thead>
        <tbody>
        <?PHP
        $jpictures_extension=array(
            'jpg','gif','png','bmp','jpeg','ico'
        );

        foreach($list as $v):
            if($this->input->get_post('created') and date('Ymd',$v['date']) != date('Ymd',strtotime($this->input->get_post('created')))){
                continue;
            }
        ?>


        <tr target="id" rel="rel">
            <td>
                <?PHP
                if($v['is_dir']){
                    $v['extension'] = 'folder';
                }
                $file_url = $site_root.str_replace(array($source_dir,'\\'),array('','/'),$v['server_path']);
                ?>
                <a mask="true" target="dialog" href="<?PHP echo __URL__.'/index?searct_keyword='.str_replace(array($source_dir.DIRECTORY_SEPARATOR),array(''),$v['server_path'])?>">
                    <span data-imgurl="" class="<?PHP echo "ico {$v['extension']} ico-{$v['extension']}"; ?>"></span>
                    <?PHP echo $v['basename']?>
                </a>



            </td>
            <td><?PHP echo $v['size']?></td>
            <td><?PHP echo date('Y-m-d H:i:s',$v['date'])?></td>
            <td>
                <a class="btnDel" href="<?php echo __URL__.'/delete/'.$v['server_path']; ?>" target="ajaxTodo" title="删除">删除</a>
                <a class="btnEdit" href="<?php echo __URL__.'/edit/'.$v['server_path']; ?>" target="navTab" title="编辑">编辑</a>
                <a title="查找带回" href="javascript:$.bringBack({filename:'<?PHP echo $file_url;?>'})" class="btnSelect">选择</a>
            </td>
        </tr>
        <?PHP endforeach; ?>
        </tbody>
    </table>

    <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <?php
            $options = array("20"  => "20","50"=> "50","100"   => "100","200"   => "200",);
            echo form_dropdown("numPerPage", $options, $this->input->get_post("numPerPage"),"class=\"combox\" onchange=\"navTabPageBreak({numPerPage:this.value})\"");
            ?>            <span>条，共<?php echo intval($this->input->get_post("totalCount"));?>条</span>
        </div>

        <div class="pagination" targetType="navTab" totalCount="<?php echo intval($this->input->get_post("totalCount"));?>" numPerPage="<?php echo intval($this->input->get_post("numPerPage"));?>" pageNumShown="10" currentPage="<?php echo intval($this->input->get_post("pageNum")); ?>"></div>

    </div>
</div>